home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume21 / rayshade / part03 < prev    next >
Encoding:
Text File  |  1991-07-21  |  53.9 KB  |  1,870 lines

  1. Newsgroups: comp.sources.misc
  2. From: Rayshade Construction Co. <rayshade@weedeater.math.YALE.EDU>
  3. Subject:  v21i006:  rayshade - A raytracing package for UNIX, Part03/19
  4. Message-ID: <1991Jul20.043345.11291@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 8450356fb326179bed42194bdba5992e
  6. Date: Sat, 20 Jul 1991 04:33:45 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Rayshade Construction Co. <rayshade@weedeater.math.YALE.EDU>
  10. Posting-number: Volume 21, Issue 6
  11. Archive-name: rayshade/part03
  12. Environment: UNIX, !16BIT
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 3 (of 19)."
  21. # Contents:  Doc/Changes Doc/Guide/transform.tex Doc/TODO
  22. #   Examples/boxball.ray Reconfigure libray/libcommon/color.h
  23. #   libray/libcommon/error.h libray/libcommon/expr.h
  24. #   libray/libcommon/rotate.h libray/libcommon/sampling.h
  25. #   libray/libcommon/translate.h libray/libimage/image.h
  26. #   libray/libobj/bounds.h libray/libobj/csg.h
  27. #   libray/libobj/instance.h libray/libobj/poly.h
  28. #   libray/libobj/torus.h libray/libsurf/atmosphere.h
  29. #   libray/libtext/blotch.c libray/libtext/bump.c
  30. #   libray/libtext/checker.c libray/libtext/fbmbump.c
  31. #   libray/libtext/gloss.c libray/libtext/imagetext.h
  32. #   libray/libtext/mount.c libshade/builtin.c libshade/stats.h
  33. #   libshade/symtab.h libshade/viewing.h
  34. # Wrapped by kolb@woody on Wed Jul 17 17:56:37 1991
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. if test -f 'Doc/Changes' -a "${1}" != "-c" ; then 
  37.   echo shar: Will not clobber existing file \"'Doc/Changes'\"
  38. else
  39. echo shar: Extracting \"'Doc/Changes'\" \(1361 characters\)
  40. sed "s/^X//" >'Doc/Changes' <<'END_OF_FILE'
  41. XMajor changes since 3.0
  42. X-----------------------
  43. XAddition of CSG.  "union", "intersect" and "difference" types.
  44. X
  45. XAnimation support.  Multi-frame image files, use of expressions, animated
  46. Xtransformations, new keywords, including: shutter, frames, framelength,
  47. Xdefine, starttime.  "linear" function, "time" and "frame" variables.
  48. X
  49. XAggregate syntax changed.  Rather than "define .... defend" with
  50. Xthe aggregate type buried inbetween, syntax is "type ... end", where type
  51. Xis one of: grid, list, union, intersect, difference.  Object naming
  52. Xis now accomplished by preceding one of the above with the "name" keyword
  53. Xfollowed by the name to assign to the aggregate.
  54. X
  55. XTorus, blob primitives added, courtesy of Mark Podlipec and Jochen Schwarze.
  56. XBuggy superquadric primitive removed.
  57. X
  58. XSurface definition syntax and binding changed.  Surface definition is now keyword-
  59. Xbased.  Note that the specular color of a surface is used to modify the color of
  60. Xreflected rays in 4.0.  When converting 3.0 scripts to 4.0, the specular component
  61. Xand/or reflectivity may need to be modified.
  62. X
  63. XImproved antialiasing.  Rather than using an adaptive scheme or nonadaptive
  64. X"distributed" ray tracing, an adaptive jittered algorithm is used.
  65. X
  66. XAdditional textures and light source types.
  67. X
  68. XVastly improved performance when using many texturing functions.
  69. X
  70. XMany minor and not-so-minor bugfixes.
  71. END_OF_FILE
  72. if test 1361 -ne `wc -c <'Doc/Changes'`; then
  73.     echo shar: \"'Doc/Changes'\" unpacked with wrong size!
  74. fi
  75. # end of 'Doc/Changes'
  76. fi
  77. if test -f 'Doc/Guide/transform.tex' -a "${1}" != "-c" ; then 
  78.   echo shar: Will not clobber existing file \"'Doc/Guide/transform.tex'\"
  79. else
  80. echo shar: Extracting \"'Doc/Guide/transform.tex'\" \(1496 characters\)
  81. sed "s/^X//" >'Doc/Guide/transform.tex' <<'END_OF_FILE'
  82. X\chapter {Transformations}
  83. X
  84. XRayshade supports the application of linear transformations to objects
  85. Xand textures.  If more than one transformation is specified, the
  86. Xtotal resulting transformation is computed and applied.
  87. X
  88. X\begin{defkey}{translate}{\evec{delta}}
  89. XTranslate (move) by {\em delta}.
  90. X\end{defkey}
  91. X
  92. X\begin{defkey}{rotate}{\evec{axis} $\theta$}
  93. XRotate counter-clockwise about the given axis by $\theta$ degrees.
  94. X\end{defkey}
  95. X
  96. X\begin{defkey}{scale}{\evec{v}}
  97. XScale by {\em v}.
  98. X\end{defkey}
  99. XAll three scaling components must be non-zero, else degenerate matrices
  100. Xwill result.
  101. X
  102. X\begin{defkey}{transform}{\evec{row1} \evec{row2} \evec{row3} [\evec{delta}]}
  103. XApply the given 3-by-3 transformation matrix.  If given, {\em delta}
  104. Xspecifies a translation vector.
  105. X\end{defkey}
  106. X
  107. XTransformations should
  108. Xbe specified in the order in which they are to be applied
  109. Ximmediately following the item to
  110. Xbe transformed.  For example:
  111. X
  112. X\begin{verbatim}
  113. X        /*
  114. X         * Ellipsoid, rotated cube
  115. X         */
  116. X        sphere 1. 0 0 0   scale 2. 1. 1. translate 0 0 -2.5
  117. X        box 0 0 0 .5 .5 .5
  118. X           rotate 0 0 1 45 rotate 1 0 0 45 translate 0 0 2.5
  119. X\end{verbatim}
  120. X
  121. XTransformations may also be applied to textures:
  122. X
  123. X\begin{verbatim}
  124. X   plane 0 0 -4  0 0 1
  125. X     texture checker red scale 2 2 2 rotate 0 0 1 45
  126. X\end{verbatim}
  127. X
  128. XNote that transformation parameters may be specified using
  129. Xof animated expressions, causing the transformations themselves
  130. Xto be animated.  See Appendix B for further details.
  131. END_OF_FILE
  132. if test 1496 -ne `wc -c <'Doc/Guide/transform.tex'`; then
  133.     echo shar: \"'Doc/Guide/transform.tex'\" unpacked with wrong size!
  134. fi
  135. # end of 'Doc/Guide/transform.tex'
  136. fi
  137. if test -f 'Doc/TODO' -a "${1}" != "-c" ; then 
  138.   echo shar: Will not clobber existing file \"'Doc/TODO'\"
  139. else
  140. echo shar: Extracting \"'Doc/TODO'\" \(1287 characters\)
  141. sed "s/^X//" >'Doc/TODO' <<'END_OF_FILE'
  142. X---------
  143. XTODO List
  144. X---------
  145. X
  146. XNon-URT images upside-down.
  147. X
  148. XIf World object has only one subobject, and the World
  149. Xis neither textured nor transformed (can't do this anyway),
  150. Xthen make that object the World object.  In theory we could
  151. Xdo this (collapsing) throughout the modeling tree.
  152. X
  153. X> 2 objects in CSG objects
  154. X
  155. XCreate nasty, rigorous test scenes, more examples in general.
  156. X
  157. XAnimated lights & camera.
  158. X
  159. XCubic interpolation functions.
  160. X
  161. XAnimated primitive/texture/surface/etc parameters.
  162. X
  163. XThere should be a windowing command that takes pixel locations
  164. Xas well as one that takes normalized coordinates.
  165. X
  166. XPut Linda code back in place.
  167. X
  168. XUser-selectable primitives/aggregates/lights/textures at compile time?
  169. X
  170. XTechnical Documentation
  171. X
  172. XMake heightfields be stored in fixed-point, and take care of byte-ordering
  173. Xproblems so that height fields are transportable from machine to machine.
  174. X
  175. XIs Bayes' theorem-based polygon intersection method better?
  176. X
  177. XAdaptive gridding.
  178. X
  179. XBetter antialiasing.
  180. X
  181. XAdd an option to perform sorting during ray/List intersection tests so
  182. Xobjects are tested approximately in order.
  183. X
  184. XExpr compressor program:  Spits out .ray file with just floats.
  185. X
  186. XOptimize blur for non-jitter case (don't exapnd bboxes, etc).
  187. X
  188. XAnimated scales and translations can modify matrix directly.
  189. END_OF_FILE
  190. if test 1287 -ne `wc -c <'Doc/TODO'`; then
  191.     echo shar: \"'Doc/TODO'\" unpacked with wrong size!
  192. fi
  193. # end of 'Doc/TODO'
  194. fi
  195. if test -f 'Examples/boxball.ray' -a "${1}" != "-c" ; then 
  196.   echo shar: Will not clobber existing file \"'Examples/boxball.ray'\"
  197. else
  198. echo shar: Extracting \"'Examples/boxball.ray'\" \(1380 characters\)
  199. sed "s/^X//" >'Examples/boxball.ray' <<'END_OF_FILE'
  200. X/*
  201. X * White diffuse sphere with wooden box-shaped regions removed.
  202. X * Rod Bogart 11/90
  203. X */
  204. Xeyep  4 3 5
  205. Xfov 15
  206. Xlight 1 directional 1 0.5 2
  207. Xsample 1    /* Increase this value for less noisy image */
  208. Xreport verbose
  209. Xscreen 320 256
  210. X
  211. Xplane 0. 0. -5. 0. 0. 1 texture marble scale 2 2 1
  212. X
  213. Xdifference
  214. X    sphere  0.65 0 0 0
  215. X    grid 3 3 3    
  216. X        applysurf ambient .2 .05 .05
  217. X              diffuse .8 .1 .05
  218. X              specular .05 .05 .05
  219. X                specpow 20
  220. X
  221. X        box 0.3 0.3 -0.7 0.7 0.7 -0.3 
  222. X        box -0.2 0.3 -0.7 0.2 0.7 -0.3 
  223. X        box -0.7 0.3 -0.7 -0.3 0.7 -0.3 
  224. X
  225. X        box 0.3 0.3 -0.2 0.7 0.7 0.2 
  226. X        box -0.2 0.3 -0.2 0.2 0.7 0.2 
  227. X        box -0.7 0.3 -0.2 -0.3 0.7 0.2 
  228. X
  229. X        box 0.3 0.3 0.3 0.7 0.7 0.7 
  230. X        box -0.2 0.3 0.3 0.2 0.7 0.7 
  231. X        box -0.7 0.3 0.3 -0.3 0.7 0.7 
  232. X
  233. X        box 0.3 -0.2 -0.7 0.7 0.2 -0.3 
  234. X        box -0.2 -0.2 -0.7 0.2 0.2 -0.3 
  235. X        box -0.7 -0.2 -0.7 -0.3 0.2 -0.3 
  236. X
  237. X        box 0.3 -0.2 -0.2 0.7 0.2 0.2 
  238. X        box -0.2 -0.2 -0.2 0.2 0.2 0.2 
  239. X        box -0.7 -0.2 -0.2 -0.3 0.2 0.2 
  240. X
  241. X        box 0.3 -0.2 0.3 0.7 0.2 0.7 
  242. X        box -0.2 -0.2 0.3 0.2 0.2 0.7 
  243. X        box -0.7 -0.2 0.3 -0.3 0.2 0.7 
  244. X
  245. X        box 0.3 -0.7 -0.7 0.7 -0.3 -0.3 
  246. X        box -0.2 -0.7 -0.7 0.2 -0.3 -0.3 
  247. X        box -0.7 -0.7 -0.7 -0.3 -0.3 -0.3 
  248. X
  249. X        box 0.3 -0.7 -0.2 0.7 -0.3 0.2 
  250. X        box -0.2 -0.7 -0.2 0.2 -0.3 0.2 
  251. X        box -0.7 -0.7 -0.2 -0.3 -0.3 0.2 
  252. X
  253. X        box 0.3 -0.7 0.3 0.7 -0.3 0.7 
  254. X        box -0.2 -0.7 0.3 0.2 -0.3 0.7 
  255. X        box -0.7 -0.7 0.3 -0.3 -0.3 0.7 
  256. X    end texture wood scale 3 1 1
  257. Xend
  258. END_OF_FILE
  259. if test 1380 -ne `wc -c <'Examples/boxball.ray'`; then
  260.     echo shar: \"'Examples/boxball.ray'\" unpacked with wrong size!
  261. fi
  262. # end of 'Examples/boxball.ray'
  263. fi
  264. if test -f 'Reconfigure' -a "${1}" != "-c" ; then 
  265.   echo shar: Will not clobber existing file \"'Reconfigure'\"
  266. else
  267. echo shar: Extracting \"'Reconfigure'\" \(1482 characters\)
  268. sed "s/^X//" >'Reconfigure' <<'END_OF_FILE'
  269. X#!/bin/sh
  270. X#
  271. X# Reconfigure
  272. X# Extract .SH files using values in config.sh
  273. X#
  274. X# Useful in environments in which the source tree
  275. X# is used to build executables for more than one kind of machine.
  276. X# After running Configure on a particular machine, copy the
  277. X# resulting config.sh to, for example, config.sh.SPARC.
  278. X# When you have to recompile for some reason, running
  279. X# "Reconfigure config.sh.SPARC" should produce the correct Makefiles
  280. X# and the like.
  281. X#
  282. X# If you need to run "make depend" for a machine other than the one
  283. X# that the Configure script was last run for, you will need to remake
  284. X# the "mkdep" script by removing it, copying the appropriate
  285. X# config.sh.MACHINE file to config.sh, and running "Configure -d".
  286. X#
  287. X
  288. Xcase "$1" in
  289. X'')
  290. X    configfile="./config.sh"
  291. X    ;;
  292. X*)
  293. X    if test -f "$1" ; then
  294. X        configfile="$1"
  295. X    else
  296. X        echo "$1 does not exist."
  297. X        exit
  298. X    fi
  299. Xesac
  300. X
  301. Xecho "Reconfiguring using $configfile."
  302. X. $configfile
  303. X
  304. Xecho " "
  305. Xecho "Doing variable substitutions on .SH files..."
  306. Xset x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  307. Xshift
  308. Xcase $# in
  309. X0) set x *.SH; shift;;
  310. Xesac
  311. Xif test ! -f $1; then
  312. X    shift
  313. Xfi
  314. Xfor file in $*; do
  315. X    case "$file" in
  316. X    */*)
  317. X    dir=`$expr X$file : 'X\(.*\)/'`
  318. X    file=`$expr X$file : 'X.*/\(.*\)'`
  319. X    (cd $dir && . $file)
  320. X    ;;
  321. X    *)
  322. X    . $file
  323. X    ;;
  324. X    esac
  325. Xdone
  326. Xif test -f config.h.SH; then
  327. X    if test ! -f config.h; then
  328. X    : oops, they left it out of MANIFEST, probably, so do it anyway.
  329. X    . config.h.SH
  330. X    fi
  331. Xfi
  332. X
  333. Xecho "You must run 'make depend' then 'make'."
  334. END_OF_FILE
  335. if test 1482 -ne `wc -c <'Reconfigure'`; then
  336.     echo shar: \"'Reconfigure'\" unpacked with wrong size!
  337. fi
  338. chmod +x 'Reconfigure'
  339. # end of 'Reconfigure'
  340. fi
  341. if test -f 'libray/libcommon/color.h' -a "${1}" != "-c" ; then 
  342.   echo shar: Will not clobber existing file \"'libray/libcommon/color.h'\"
  343. else
  344. echo shar: Extracting \"'libray/libcommon/color.h'\" \(1241 characters\)
  345. sed "s/^X//" >'libray/libcommon/color.h' <<'END_OF_FILE'
  346. X/*
  347. X * color.h
  348. X *
  349. X * Copyright (C) 1989, 1991, Craig E. Kolb
  350. X * All rights reserved.
  351. X *
  352. X * This software may be freely copied, modified, and redistributed
  353. X * provided that this copyright notice is preserved on all copies.
  354. X *
  355. X * You may not distribute this software, in whole or in part, as part of
  356. X * any commercial product without the express consent of the authors.
  357. X *
  358. X * There is no warranty or other guarantee of fitness of this software
  359. X * for any purpose.  It is provided solely "as is".
  360. X *
  361. X * $Id: color.h,v 4.0 91/07/17 14:30:08 kolb Exp Locker: kolb $
  362. X *
  363. X * $Log:    color.h,v $
  364. X * Revision 4.0  91/07/17  14:30:08  kolb
  365. X * Initial version.
  366. X * 
  367. X */
  368. X#ifndef COLOR_H
  369. X#define COLOR_H
  370. X/*
  371. X * Color
  372. X */
  373. Xtypedef struct Color {
  374. X    Float r, g, b;            /* Red, green, blue. */
  375. X} Color;
  376. X
  377. X#define ColorScale(s,c,a)        (a)->r = (s)*(c).r, \
  378. X                    (a)->g = (s)*(c).g, \
  379. X                    (a)->b = (s)*(c).b
  380. X
  381. X#define ColorAddScaled(x, s, y, c)    (c)->r = (x).r + (s)*(y).r, \
  382. X                    (c)->g = (x).g + (s)*(y).g, \
  383. X                    (c)->b = (x).b + (s)*(y).b
  384. X
  385. X#define ColorMultiply(x,y,a)        (a)->r = (x).r*(y).r, \
  386. X                    (a)->g = (x).g*(y).g, \
  387. X                    (a)->b = (x).b*(y).b
  388. X
  389. X#define ColorAdd(x,y,a)            (a)->r = (x).r+(y).r, \
  390. X                    (a)->g = (x).g+(y).g, \
  391. X                    (a)->b = (x).b+(y).b
  392. X#endif COLOR_H
  393. END_OF_FILE
  394. if test 1241 -ne `wc -c <'libray/libcommon/color.h'`; then
  395.     echo shar: \"'libray/libcommon/color.h'\" unpacked with wrong size!
  396. fi
  397. # end of 'libray/libcommon/color.h'
  398. fi
  399. if test -f 'libray/libcommon/error.h' -a "${1}" != "-c" ; then 
  400.   echo shar: Will not clobber existing file \"'libray/libcommon/error.h'\"
  401. else
  402. echo shar: Extracting \"'libray/libcommon/error.h'\" \(1417 characters\)
  403. sed "s/^X//" >'libray/libcommon/error.h' <<'END_OF_FILE'
  404. X/*
  405. X * error.h
  406. X *
  407. X * Copyright (C) 1989, 1991, Craig E. Kolb
  408. X * All rights reserved.
  409. X *
  410. X * This software may be freely copied, modified, and redistributed
  411. X * provided that this copyright notice is preserved on all copies.
  412. X *
  413. X * You may not distribute this software, in whole or in part, as part of
  414. X * any commercial product without the express consent of the authors.
  415. X *
  416. X * There is no warranty or other guarantee of fitness of this software
  417. X * for any purpose.  It is provided solely "as is".
  418. X *
  419. X * $Id: error.h,v 4.0 91/07/17 14:30:27 kolb Exp Locker: kolb $
  420. X *
  421. X * $Log:    error.h,v $
  422. X * Revision 4.0  91/07/17  14:30:27  kolb
  423. X * Initial version.
  424. X * 
  425. X */
  426. X#ifndef ERROR_H
  427. X#define ERROR_H
  428. X/*
  429. X * Error severity codes, passed to user-provided RLerror()
  430. X * function which optionally prints and optionally exits.
  431. X *
  432. X * RL_ADVISE    Message may safely be safely suppressed, though
  433. X *        the resulting image may not be exactly what you expect.
  434. X * RL_WARN    Message should probably be printed; image will most
  435. X *        likely be affected.
  436. X * RL_ABORT    Message should be printed -- couldn't perform a request.
  437. X *        The resulting image will be affected.
  438. X * RL_PANIC    Fatal error -- call to RLerror() must not return.
  439. X */
  440. X#define RL_ADVISE    0    /* Advisory */
  441. X#define RL_WARN        1    /* Warning */
  442. X#define RL_ABORT    2    /* Aborted */
  443. X#define RL_PANIC    3    /* Panic */
  444. X
  445. Xextern void RLerror();        /* application-supplied reporting routine */
  446. X#endif /* ERROR_H */
  447. END_OF_FILE
  448. if test 1417 -ne `wc -c <'libray/libcommon/error.h'`; then
  449.     echo shar: \"'libray/libcommon/error.h'\" unpacked with wrong size!
  450. fi
  451. # end of 'libray/libcommon/error.h'
  452. fi
  453. if test -f 'libray/libcommon/expr.h' -a "${1}" != "-c" ; then 
  454.   echo shar: Will not clobber existing file \"'libray/libcommon/expr.h'\"
  455. else
  456. echo shar: Extracting \"'libray/libcommon/expr.h'\" \(1552 characters\)
  457. sed "s/^X//" >'libray/libcommon/expr.h' <<'END_OF_FILE'
  458. X/*
  459. X * expr.h
  460. X *
  461. X * Copyright (C) 1989, 1991, Craig E. Kolb, Rod G. Bogart
  462. X * All rights reserved.
  463. X *
  464. X * This software may be freely copied, modified, and redistributed
  465. X * provided that this copyright notice is preserved on all copies.
  466. X *
  467. X * You may not distribute this software, in whole or in part, as part of
  468. X * any commercial product without the express consent of the authors.
  469. X * 
  470. X * There is no warranty or other guarantee of fitness of this software
  471. X * for any purpose.  It is provided solely "as is".
  472. X *
  473. X * $Id: expr.h,v 4.0 91/07/17 14:30:47 kolb Exp Locker: kolb $
  474. X *
  475. X * $Log:    expr.h,v $
  476. X * Revision 4.0  91/07/17  14:30:47  kolb
  477. X * Initial version.
  478. X * 
  479. X */
  480. X#ifndef EXPR_H
  481. X#define EXPR_H
  482. X
  483. X#define FLOAT_EXPR        0
  484. X#define BUILTIN_EXPR        1
  485. X
  486. Xtypedef struct Expr {
  487. X    short    type,            /* Expr type (float/builtin/time) */
  488. X        timevary,        /* does the expr vary over time? */
  489. X        symtab,            /* is the expr in the symtab? */
  490. X        nparams;        /* # of params, if builtin */
  491. X    Float    value,            /* float val/last eval if timeexpr */
  492. X        timenow,        /* time of last evaluation */
  493. X        (*function)();
  494. X    struct Expr **params;        /* parameters, if a builtin */
  495. X} Expr;
  496. X
  497. Xtypedef struct ExprAssoc {
  498. X    Float *lhs;            /* left-hand side */
  499. X    Expr *expr;            /* right-hand side */
  500. X    struct ExprAssoc *next;        /* Next in list */
  501. X} ExprAssoc;
  502. X    
  503. Xextern Float    ExprEval();
  504. X
  505. Xextern Expr    *ExprResolve1(), *ExprResolve2(), *ExprResolve3(),
  506. X        *ExprResolve4(), *ExprResolve5(), *ExprFloatCreate();
  507. Xextern Expr    *TimeExpr, *FrameExpr, *ExprReuseFloatCreate();
  508. X
  509. Xextern ExprAssoc *AssocCreate();
  510. X
  511. X#endif /* EXPR_H */
  512. END_OF_FILE
  513. if test 1552 -ne `wc -c <'libray/libcommon/expr.h'`; then
  514.     echo shar: \"'libray/libcommon/expr.h'\" unpacked with wrong size!
  515. fi
  516. # end of 'libray/libcommon/expr.h'
  517. fi
  518. if test -f 'libray/libcommon/rotate.h' -a "${1}" != "-c" ; then 
  519.   echo shar: Will not clobber existing file \"'libray/libcommon/rotate.h'\"
  520. else
  521. echo shar: Extracting \"'libray/libcommon/rotate.h'\" \(1244 characters\)
  522. sed "s/^X//" >'libray/libcommon/rotate.h' <<'END_OF_FILE'
  523. X/*
  524. X * rotate.h
  525. X *
  526. X * Copyright (C) 1989, 1991, Craig E. Kolb
  527. X * All rights reserved.
  528. X *
  529. X * This software may be freely copied, modified, and redistributed
  530. X * provided that this copyright notice is preserved on all copies.
  531. X *
  532. X * You may not distribute this software, in whole or in part, as part of
  533. X * any commercial product without the express consent of the authors.
  534. X * 
  535. X * There is no warranty or other guarantee of fitness of this software
  536. X * for any purpose.  It is provided solely "as is".
  537. X *
  538. X * $Id: rotate.h,v 4.0 91/07/17 14:31:26 kolb Exp Locker: kolb $
  539. X *
  540. X * $Log:    rotate.h,v $
  541. X * Revision 4.0  91/07/17  14:31:26  kolb
  542. X * Initial version.
  543. X * 
  544. X */
  545. X#ifndef ROTATE_H
  546. X#define ROTATE_H
  547. X
  548. X#define TransRotateCreate()        TransCreate((TransRef)RotateCreate(), RotateMethods())
  549. X
  550. X#define TransRotateSetX(t, v)        TransAssoc(t, &((Rotate *)t->tr)->x, v)
  551. X#define TransRotateSetY(t, v)        TransAssoc(t, &((Rotate *)t->tr)->y, v)
  552. X#define TransRotateSetZ(t, v)        TransAssoc(t, &((Rotate *)t->tr)->z, v)
  553. X#define TransRotateSetTheta(t, v)    TransAssoc(t, &((Rotate *)t->tr)->theta, v)
  554. X
  555. Xtypedef struct {
  556. X    Float x, y, z, theta;
  557. X} Rotate;
  558. X
  559. Xextern Rotate *RotateCreate();
  560. Xextern TransMethods *RotateMethods();
  561. Xextern void RotatePropagate();
  562. X
  563. X#endif /* ROTATE_H */
  564. END_OF_FILE
  565. if test 1244 -ne `wc -c <'libray/libcommon/rotate.h'`; then
  566.     echo shar: \"'libray/libcommon/rotate.h'\" unpacked with wrong size!
  567. fi
  568. # end of 'libray/libcommon/rotate.h'
  569. fi
  570. if test -f 'libray/libcommon/sampling.h' -a "${1}" != "-c" ; then 
  571.   echo shar: Will not clobber existing file \"'libray/libcommon/sampling.h'\"
  572. else
  573. echo shar: Extracting \"'libray/libcommon/sampling.h'\" \(1485 characters\)
  574. sed "s/^X//" >'libray/libcommon/sampling.h' <<'END_OF_FILE'
  575. X/*
  576. X * sampling.h
  577. X *
  578. X * Copyright (C) 1989, 1991, Craig E. Kolb
  579. X * All rights reserved.
  580. X *
  581. X * This software may be freely copied, modified, and redistributed
  582. X * provided that this copyright notice is preserved on all copies.
  583. X *
  584. X * You may not distribute this software, in whole or in part, as part of
  585. X * any commercial product without the express consent of the authors.
  586. X *
  587. X * There is no warranty or other guarantee of fitness of this software
  588. X * for any purpose.  It is provided solely "as is".
  589. X *
  590. X * $Id: sampling.h,v 4.0 91/07/17 14:32:01 kolb Exp Locker: kolb $
  591. X *
  592. X * $Log:    sampling.h,v $
  593. X * Revision 4.0  91/07/17  14:32:01  kolb
  594. X * Initial version.
  595. X * 
  596. X */
  597. X#ifndef SAMPLING_H
  598. X#define SAMPLING_H
  599. X
  600. X/*
  601. X * # of subsamples to take within each of the totsamples slots when
  602. X * computing 'animated' bounding boxes.
  603. X */
  604. X#define TIME_SUB_SAMPLES    10
  605. X
  606. Xtypedef struct SampleInfo {
  607. X    int    totsamples,    /* # of samples/pixel */
  608. X        sidesamples,    /* sqrt(samples) */
  609. X        gaussian,    /* gaussian filter? */
  610. X        framenum,    /* current frame numer */
  611. X        timemagic;    /* # of time samples per screen... */
  612. X    Float    weight,        /* 1. / totsamples */
  613. X        spacing,    /* 1. / sidesamples  */
  614. X        filterwidth,    /* total width of filter */
  615. X        filterdelta,    /* filterwidth * spacing */
  616. X        **filter,    /* pixel filter, sidesamp by sidesamp */
  617. X        starttime,    /* start time */
  618. X        shutter;    /* length of time shutter is open */
  619. X} SampleInfo;
  620. X
  621. Xextern SampleInfo Sampling;
  622. X
  623. Xextern void    SamplingSetOptions(), UnitCirclePoint();
  624. X
  625. X#endif /* SAMPLING */
  626. END_OF_FILE
  627. if test 1485 -ne `wc -c <'libray/libcommon/sampling.h'`; then
  628.     echo shar: \"'libray/libcommon/sampling.h'\" unpacked with wrong size!
  629. fi
  630. # end of 'libray/libcommon/sampling.h'
  631. fi
  632. if test -f 'libray/libcommon/translate.h' -a "${1}" != "-c" ; then 
  633.   echo shar: Will not clobber existing file \"'libray/libcommon/translate.h'\"
  634. else
  635. echo shar: Extracting \"'libray/libcommon/translate.h'\" \(1199 characters\)
  636. sed "s/^X//" >'libray/libcommon/translate.h' <<'END_OF_FILE'
  637. X/*
  638. X * translate.h
  639. X *
  640. X * Copyright (C) 1989, 1991, Craig E. Kolb
  641. X * All rights reserved.
  642. X *
  643. X * This software may be freely copied, modified, and redistributed
  644. X * provided that this copyright notice is preserved on all copies.
  645. X *
  646. X * You may not distribute this software, in whole or in part, as part of
  647. X * any commercial product without the express consent of the authors.
  648. X * 
  649. X * There is no warranty or other guarantee of fitness of this software
  650. X * for any purpose.  It is provided solely "as is".
  651. X *
  652. X * $Id: translate.h,v 4.0 91/07/17 14:32:49 kolb Exp Locker: kolb $
  653. X *
  654. X * $Log:    translate.h,v $
  655. X * Revision 4.0  91/07/17  14:32:49  kolb
  656. X * Initial version.
  657. X * 
  658. X */
  659. X#ifndef TRANSLATE_H
  660. X#define TRANSLATE_H
  661. X
  662. X#define TransTranslateCreate()        TransCreate((TransRef)TranslateCreate(), TranslateMethods())
  663. X
  664. X#define TransTranslateSetX(t, v)        TransAssoc(t, &((Translate *)t->tr)->x, v)
  665. X#define TransTranslateSetY(t, v)        TransAssoc(t, &((Translate *)t->tr)->y, v)
  666. X#define TransTranslateSetZ(t, v)        TransAssoc(t, &((Translate *)t->tr)->z, v)
  667. X
  668. Xtypedef Vector Translate;
  669. X
  670. Xextern Translate *TranslateCreate();
  671. Xextern TransMethods *TranslateMethods();
  672. Xextern void TranslatePropagate();
  673. X
  674. X#endif /* TRANSLATE_H */
  675. END_OF_FILE
  676. if test 1199 -ne `wc -c <'libray/libcommon/translate.h'`; then
  677.     echo shar: \"'libray/libcommon/translate.h'\" unpacked with wrong size!
  678. fi
  679. # end of 'libray/libcommon/translate.h'
  680. fi
  681. if test -f 'libray/libimage/image.h' -a "${1}" != "-c" ; then 
  682.   echo shar: Will not clobber existing file \"'libray/libimage/image.h'\"
  683. else
  684. echo shar: Extracting \"'libray/libimage/image.h'\" \(1190 characters\)
  685. sed "s/^X//" >'libray/libimage/image.h' <<'END_OF_FILE'
  686. X/*
  687. X * image.h
  688. X *
  689. X * Copyright (C) 1989, 1991, Rod G. Bogart, Craig E. Kolb
  690. X * All rights reserved.
  691. X *
  692. X * This software may be freely copied, modified, and redistributed
  693. X * provided that this copyright notice is preserved on all copies.
  694. X *
  695. X * You may not distribute this software, in whole or in part, as part of
  696. X * any commercial product without the express consent of the authors.
  697. X *
  698. X * There is no warranty or other guarantee of fitness of this software
  699. X * for any purpose.  It is provided solely "as is".
  700. X *
  701. X * $Id: image.h,v 4.0 91/07/17 14:33:39 kolb Exp Locker: kolb $
  702. X *
  703. X * $Log:    image.h,v $
  704. X * Revision 4.0  91/07/17  14:33:39  kolb
  705. X * Initial version.
  706. X * 
  707. X */
  708. X#ifndef IMAGE_H
  709. X#define IMAGE_H
  710. X
  711. X/*
  712. X * Generic image object for texture map storage.
  713. X */
  714. Xtypedef struct Image {
  715. X    int    width, height,        /* Image size */
  716. X        chan, has_alpha,    /* # of channels, has alpha info? */
  717. X        totalchan,        /* # channels + any alpha channel */
  718. X        chansize;        /* width * height */
  719. X    unsigned char *data;        /* Image */
  720. X    char    *filename;        /* Filename (identifier) */
  721. X    struct Image *next;        /* Next image in list. */
  722. X} Image;
  723. X
  724. XImage    *ImageCreate(), *ImageFind(), *ImageRead();
  725. Xvoid    ImageIndex();
  726. X
  727. X#endif /* IMAGE_H */
  728. END_OF_FILE
  729. if test 1190 -ne `wc -c <'libray/libimage/image.h'`; then
  730.     echo shar: \"'libray/libimage/image.h'\" unpacked with wrong size!
  731. fi
  732. # end of 'libray/libimage/image.h'
  733. fi
  734. if test -f 'libray/libobj/bounds.h' -a "${1}" != "-c" ; then 
  735.   echo shar: Will not clobber existing file \"'libray/libobj/bounds.h'\"
  736. else
  737. echo shar: Extracting \"'libray/libobj/bounds.h'\" \(1348 characters\)
  738. sed "s/^X//" >'libray/libobj/bounds.h' <<'END_OF_FILE'
  739. X/*
  740. X * bounds.h
  741. X *
  742. X * Copyright (C) 1989, 1991, Craig E. Kolb
  743. X * All rights reserved.
  744. X *
  745. X * This software may be freely copied, modified, and redistributed
  746. X * provided that this copyright notice is preserved on all copies.
  747. X *
  748. X * You may not distribute this software, in whole or in part, as part of
  749. X * any commercial product without the express consent of the authors.
  750. X *
  751. X * There is no warranty or other guarantee of fitness of this software
  752. X * for any purpose.  It is provided solely "as is".
  753. X *
  754. X * $Id: bounds.h,v 4.0 91/07/17 14:36:26 kolb Exp Locker: kolb $
  755. X *
  756. X * $Log:    bounds.h,v $
  757. X * Revision 4.0  91/07/17  14:36:26  kolb
  758. X * Initial version.
  759. X * 
  760. X */
  761. X#ifndef BOUNDS_H
  762. X#define BOUNDS_H
  763. X
  764. X/*
  765. X * Used to make indices into bounding box arrays more readable.
  766. X */
  767. X#define X    0
  768. X#define Y    1
  769. X#define Z    2
  770. X#define LOW    0
  771. X#define HIGH    1
  772. X
  773. X/*
  774. X * If minimum X is greater than maximum, then
  775. X * is considered to be unbounded.
  776. X */
  777. X
  778. X#define UNBOUNDED(o)    ((o)->bounds[LOW][X] > (o)->bounds[HIGH][X])
  779. X
  780. X/*
  781. X * Is the point p outside of the bounding box "b"?
  782. X */
  783. X#define OutOfBounds(p,b) ((p)->x < b[0][0] || (p)->x > b[1][0] ||\
  784. X              (p)->y < b[0][1] || (p)->y > b[1][1] ||\
  785. X              (p)->z < b[0][2] || (p)->z > b[1][2])
  786. X
  787. Xextern void     BoundsCopy(), BoundsPrint(),
  788. X        BoundsInit(), BoundsEnlarge(),
  789. X        BoundsTransform();
  790. X
  791. Xextern int    BoundsIntersect();
  792. X#endif /* BOUNDS_H */
  793. END_OF_FILE
  794. if test 1348 -ne `wc -c <'libray/libobj/bounds.h'`; then
  795.     echo shar: \"'libray/libobj/bounds.h'\" unpacked with wrong size!
  796. fi
  797. # end of 'libray/libobj/bounds.h'
  798. fi
  799. if test -f 'libray/libobj/csg.h' -a "${1}" != "-c" ; then 
  800.   echo shar: Will not clobber existing file \"'libray/libobj/csg.h'\"
  801. else
  802. echo shar: Extracting \"'libray/libobj/csg.h'\" \(1237 characters\)
  803. sed "s/^X//" >'libray/libobj/csg.h' <<'END_OF_FILE'
  804. X/*
  805. X * csg.h
  806. X *
  807. X * Copyright (C) 1989, 1991, Craig E. Kolb
  808. X * All rights reserved.
  809. X *
  810. X * This software may be freely copied, modified, and redistributed
  811. X * provided that this copyright notice is preserved on all copies.
  812. X *
  813. X * You may not distribute this software, in whole or in part, as part of
  814. X * any commercial product without the express consent of the authors.
  815. X *
  816. X * There is no warranty or other guarantee of fitness of this software
  817. X * for any purpose.  It is provided solely "as is".
  818. X *
  819. X * $Id: csg.h,v 4.0 91/07/17 14:37:06 kolb Exp Locker: kolb $
  820. X *
  821. X * $Log:    csg.h,v $
  822. X * Revision 4.0  91/07/17  14:37:06  kolb
  823. X * Initial version.
  824. X * 
  825. X */
  826. X#ifndef CSG_H
  827. X#define CSG_H
  828. X
  829. X#define GeomCsgCreate(t)    GeomCreate((GeomRef)CsgCreate(t), CsgMethods())
  830. X
  831. X/*
  832. X * CSG (Constructive Solid Geometry)
  833. X */
  834. X#define CSG_UNION    0
  835. X#define CSG_INTERSECT    1
  836. X#define CSG_DIFFERENCE    2
  837. X
  838. Xtypedef struct Csg {
  839. X    char operator;            /* Union, Intersect, or Difference */
  840. X    struct Geom *obj1, *obj2;
  841. X    int (*intmeth)();        /* Intersection method. */
  842. X    Float bounds[2][3];
  843. X} Csg;
  844. X
  845. Xextern char    *CsgName();
  846. Xextern Csg    *CsgCreate();
  847. Xextern int    CsgIntersect(), CsgConvert();
  848. Xextern void    CsgBounds();
  849. Xextern int    FirstCsgGeom();
  850. Xextern Methods    *CsgMethods();
  851. X
  852. X#endif /* CSG_H */
  853. END_OF_FILE
  854. if test 1237 -ne `wc -c <'libray/libobj/csg.h'`; then
  855.     echo shar: \"'libray/libobj/csg.h'\" unpacked with wrong size!
  856. fi
  857. # end of 'libray/libobj/csg.h'
  858. fi
  859. if test -f 'libray/libobj/instance.h' -a "${1}" != "-c" ; then 
  860.   echo shar: Will not clobber existing file \"'libray/libobj/instance.h'\"
  861. else
  862. echo shar: Extracting \"'libray/libobj/instance.h'\" \(1159 characters\)
  863. sed "s/^X//" >'libray/libobj/instance.h' <<'END_OF_FILE'
  864. X/*
  865. X * instance.h
  866. X *
  867. X * Copyright (C) 1989, 1991, Craig E. Kolb
  868. X * All rights reserved.
  869. X *
  870. X * This software may be freely copied, modified, and redistributed
  871. X * provided that this copyright notice is preserved on all copies.
  872. X *
  873. X * You may not distribute this software, in whole or in part, as part of
  874. X * any commercial product without the express consent of the authors.
  875. X *
  876. X * There is no warranty or other guarantee of fitness of this software
  877. X * for any purpose.  It is provided solely "as is".
  878. X *
  879. X * $Id: instance.h,v 4.0 91/07/17 14:38:30 kolb Exp Locker: kolb $
  880. X *
  881. X * $Log:    instance.h,v $
  882. X * Revision 4.0  91/07/17  14:38:30  kolb
  883. X * Initial version.
  884. X * 
  885. X */
  886. X#ifndef INSTANCE_H
  887. X#define INSTANCE_H
  888. X
  889. X#define GeomInstanceCreate(o)  GeomCreate((GeomRef)InstanceCreate(o), \
  890. X                    InstanceMethods())
  891. X
  892. X/*
  893. X * Instance object
  894. X */
  895. Xtypedef struct {
  896. X    struct Geom *obj;    /* Geom being instantiated */
  897. X    Float bounds[2][3];    /* Bounding box of object */
  898. X} Instance;
  899. X
  900. Xextern char    *InstanceName();
  901. Xextern int    InstanceIntersect(), InstanceConvert();
  902. Xextern void    InstanceBounds();
  903. Xextern Instance    *InstanceCreate();
  904. Xextern Methods    *InstanceMethods();
  905. X
  906. X#endif /* INSTANCE_H */
  907. END_OF_FILE
  908. if test 1159 -ne `wc -c <'libray/libobj/instance.h'`; then
  909.     echo shar: \"'libray/libobj/instance.h'\" unpacked with wrong size!
  910. fi
  911. # end of 'libray/libobj/instance.h'
  912. fi
  913. if test -f 'libray/libobj/poly.h' -a "${1}" != "-c" ; then 
  914.   echo shar: Will not clobber existing file \"'libray/libobj/poly.h'\"
  915. else
  916. echo shar: Extracting \"'libray/libobj/poly.h'\" \(1275 characters\)
  917. sed "s/^X//" >'libray/libobj/poly.h' <<'END_OF_FILE'
  918. X/*
  919. X * poly.h
  920. X *
  921. X * Copyright (C) 1989, 1991, Craig E. Kolb
  922. X * All rights reserved.
  923. X *
  924. X * This software may be freely copied, modified, and redistributed
  925. X * provided that this copyright notice is preserved on all copies.
  926. X *
  927. X * You may not distribute this software, in whole or in part, as part of
  928. X * any commercial product without the express consent of the authors.
  929. X *
  930. X * There is no warranty or other guarantee of fitness of this software
  931. X * for any purpose.  It is provided solely "as is".
  932. X *
  933. X * $Id: poly.h,v 4.0 91/07/17 14:39:04 kolb Exp Locker: kolb $
  934. X *
  935. X * $Log:    poly.h,v $
  936. X * Revision 4.0  91/07/17  14:39:04  kolb
  937. X * Initial version.
  938. X * 
  939. X */
  940. X#ifndef POLY_H
  941. X#define POLY_H
  942. X
  943. X#define GeomPolygonCreate(r,p,f) GeomCreate((GeomRef)PolygonCreate(r,p,f), \
  944. X                    PolygonMethods())
  945. X
  946. X/*
  947. X * Polygon
  948. X */
  949. Xtypedef struct {
  950. X    Vector norm;        /* Normal to polygon */
  951. X    Float d;        /* Plane constant */
  952. X    char index;        /* Which normal coord is "dominant"? */
  953. X    Vector *points;        /* Array of vertices */
  954. X    int npoints;        /* Number of vertices */
  955. X} Polygon;
  956. X
  957. Xextern Polygon    *PolygonCreate();
  958. Xextern Methods    *PolygonMethods();
  959. Xextern int    PolygonIntersect(), PolygonEnter(), PolygonNormal();
  960. Xextern void    PolygonBounds(), PolygonUV(), PolygonStats();
  961. Xextern char    *PolygonName();
  962. X
  963. X#endif /* POLY_H */
  964. END_OF_FILE
  965. if test 1275 -ne `wc -c <'libray/libobj/poly.h'`; then
  966.     echo shar: \"'libray/libobj/poly.h'\" unpacked with wrong size!
  967. fi
  968. # end of 'libray/libobj/poly.h'
  969. fi
  970. if test -f 'libray/libobj/torus.h' -a "${1}" != "-c" ; then 
  971.   echo shar: Will not clobber existing file \"'libray/libobj/torus.h'\"
  972. else
  973. echo shar: Extracting \"'libray/libobj/torus.h'\" \(1216 characters\)
  974. sed "s/^X//" >'libray/libobj/torus.h' <<'END_OF_FILE'
  975. X/*
  976. X * torus.h
  977. X *
  978. X * Copyright (C) 1990, 1991, Mark Polipec, Craig E. Kolb
  979. X * All rights reserved.
  980. X *
  981. X * This software may be freely copied, modified, and redistributed
  982. X * provided that this copyright notice is preserved on all copies.
  983. X *
  984. X * You may not distribute this software, in whole or in part, as part of
  985. X * any commercial product without the express consent of the authors.
  986. X *
  987. X * There is no warranty or other guarantee of fitness of this software
  988. X * for any purpose.  It is provided solely "as is".
  989. X *
  990. X * $Id: torus.h,v 4.0 91/07/17 14:39:31 kolb Exp Locker: kolb $
  991. X *
  992. X * $Log:    torus.h,v $
  993. X * Revision 4.0  91/07/17  14:39:31  kolb
  994. X * Initial version.
  995. X * 
  996. X */
  997. X#ifndef TORUS_H
  998. X#define TORUS_H
  999. X
  1000. X#define GeomTorusCreate(a,b,p,n) GeomCreate((GeomRef)TorusCreate(a,b,p,n), \
  1001. X                    TorusMethods())
  1002. X
  1003. X/*
  1004. X * Torus
  1005. X */
  1006. Xtypedef struct {
  1007. X    Float a;        /* tube radius */
  1008. X    Float b;        /* swept radius */
  1009. X    Float aa, bb;        /* squares of the above */
  1010. X    Trans trans;        /* general<-->canonical transform */
  1011. X} Torus;
  1012. X
  1013. Xextern Torus    *TorusCreate();
  1014. Xextern int    TorusIntersect(), TorusEnter(), TorusNormal();
  1015. Xextern void    TorusBounds(), TorusUV(), TorusStats();
  1016. Xextern char    *TorusName();
  1017. Xextern Methods    *TorusMethods();
  1018. X
  1019. X#endif /* TORUS_H */
  1020. END_OF_FILE
  1021. if test 1216 -ne `wc -c <'libray/libobj/torus.h'`; then
  1022.     echo shar: \"'libray/libobj/torus.h'\" unpacked with wrong size!
  1023. fi
  1024. # end of 'libray/libobj/torus.h'
  1025. fi
  1026. if test -f 'libray/libsurf/atmosphere.h' -a "${1}" != "-c" ; then 
  1027.   echo shar: Will not clobber existing file \"'libray/libsurf/atmosphere.h'\"
  1028. else
  1029. echo shar: Extracting \"'libray/libsurf/atmosphere.h'\" \(1227 characters\)
  1030. sed "s/^X//" >'libray/libsurf/atmosphere.h' <<'END_OF_FILE'
  1031. X/*
  1032. X * atmosphere.h
  1033. X *
  1034. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1035. X * All rights reserved.
  1036. X *
  1037. X * This software may be freely copied, modified, and redistributed
  1038. X * provided that this copyright notice is preserved on all copies.
  1039. X *
  1040. X * You may not distribute this software, in whole or in part, as part of
  1041. X * any commercial product without the express consent of the authors.
  1042. X *
  1043. X * There is no warranty or other guarantee of fitness of this software
  1044. X * for any purpose.  It is provided solely "as is".
  1045. X *
  1046. X * $Id: atmosphere.h,v 4.0 91/07/17 14:40:06 kolb Exp Locker: kolb $
  1047. X *
  1048. X * $Log:    atmosphere.h,v $
  1049. X * Revision 4.0  91/07/17  14:40:06  kolb
  1050. X * Initial version.
  1051. X * 
  1052. X */
  1053. X#ifndef ATMOSPHERE_H
  1054. X#define ATMOSPHERE_H
  1055. X
  1056. X#include "libcommon/common.h"
  1057. X
  1058. Xtypedef char * AtmosRef;
  1059. X
  1060. Xtypedef struct Medium {
  1061. X    Float    index,            /* Index of refraction */
  1062. X        statten;        /* specular transmission attenuation */    
  1063. X    struct Medium *next;
  1064. X} Medium;
  1065. X
  1066. Xtypedef struct Atmosphere {
  1067. X    AtmosRef data;            /* Effect info */
  1068. X    void    (*method)();        /* Atmosphere method */
  1069. X    struct Atmosphere *next;    /* Next effect */
  1070. X} Atmosphere;
  1071. X
  1072. Xextern Medium        *MediumPush();
  1073. Xextern Atmosphere    *AtmosCreate(), *AtmosphereCopy();
  1074. Xextern void        Atmospherics();
  1075. X
  1076. X#endif /* ATMOSPHERE_H */
  1077. END_OF_FILE
  1078. if test 1227 -ne `wc -c <'libray/libsurf/atmosphere.h'`; then
  1079.     echo shar: \"'libray/libsurf/atmosphere.h'\" unpacked with wrong size!
  1080. fi
  1081. # end of 'libray/libsurf/atmosphere.h'
  1082. fi
  1083. if test -f 'libray/libtext/blotch.c' -a "${1}" != "-c" ; then 
  1084.   echo shar: Will not clobber existing file \"'libray/libtext/blotch.c'\"
  1085. else
  1086. echo shar: Extracting \"'libray/libtext/blotch.c'\" \(1369 characters\)
  1087. sed "s/^X//" >'libray/libtext/blotch.c' <<'END_OF_FILE'
  1088. X/*
  1089. X * blotch.c
  1090. X *
  1091. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1092. X * All rights reserved.
  1093. X *
  1094. X * This software may be freely copied, modified, and redistributed
  1095. X * provided that this copyright notice is preserved on all copies.
  1096. X *
  1097. X * You may not distribute this software, in whole or in part, as part of
  1098. X * any commercial product without the express consent of the authors.
  1099. X *
  1100. X * There is no warranty or other guarantee of fitness of this software
  1101. X * for any purpose.  It is provided solely "as is".
  1102. X *
  1103. X * $Id: blotch.c,v 4.0 91/07/17 14:41:31 kolb Exp Locker: kolb $
  1104. X *
  1105. X * $Log:    blotch.c,v $
  1106. X * Revision 4.0  91/07/17  14:41:31  kolb
  1107. X * Initial version.
  1108. X * 
  1109. X */
  1110. X#include "texture.h"
  1111. X#include "blotch.h"
  1112. X
  1113. X/*
  1114. X * Create and return a reference to a "blotch" texture.
  1115. X */
  1116. XBlotch *
  1117. XBlotchCreate(mix, surf)
  1118. XFloat mix;
  1119. XSurface *surf;
  1120. X{
  1121. X    Blotch *blotch;
  1122. X
  1123. X    blotch = (Blotch *)Malloc(sizeof(Blotch));
  1124. X    blotch->mix = mix;
  1125. X    blotch->surf = surf;
  1126. X    return blotch;
  1127. X}
  1128. X
  1129. X/*
  1130. X * Apply "blotch" texture.
  1131. X */
  1132. X/*ARGSUSED*/
  1133. Xvoid
  1134. XBlotchApply(blotch, prim, ray, pos, norm, gnorm, surf)
  1135. XBlotch *blotch;
  1136. XGeom *prim;
  1137. XRay *ray;
  1138. XVector *pos, *norm, *gnorm;
  1139. XSurface *surf;
  1140. X{
  1141. X    Float val;
  1142. X
  1143. X    /*
  1144. X     * "mix" represents the 'average' noise value at a point.
  1145. X     */
  1146. X    val = Noise3(pos);
  1147. X    if (val > blotch->mix) {
  1148. X        val = (val - blotch->mix) / (1. - blotch->mix);
  1149. X        SurfaceBlend(surf, blotch->surf, 1. - val, val);
  1150. X    }
  1151. X}
  1152. END_OF_FILE
  1153. if test 1369 -ne `wc -c <'libray/libtext/blotch.c'`; then
  1154.     echo shar: \"'libray/libtext/blotch.c'\" unpacked with wrong size!
  1155. fi
  1156. # end of 'libray/libtext/blotch.c'
  1157. fi
  1158. if test -f 'libray/libtext/bump.c' -a "${1}" != "-c" ; then 
  1159.   echo shar: Will not clobber existing file \"'libray/libtext/bump.c'\"
  1160. else
  1161. echo shar: Extracting \"'libray/libtext/bump.c'\" \(1213 characters\)
  1162. sed "s/^X//" >'libray/libtext/bump.c' <<'END_OF_FILE'
  1163. X/*
  1164. X * bump.c
  1165. X *
  1166. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1167. X * All rights reserved.
  1168. X *
  1169. X * This software may be freely copied, modified, and redistributed
  1170. X * provided that this copyright notice is preserved on all copies.
  1171. X *
  1172. X * You may not distribute this software, in whole or in part, as part of
  1173. X * any commercial product without the express consent of the authors.
  1174. X *
  1175. X * There is no warranty or other guarantee of fitness of this software
  1176. X * for any purpose.  It is provided solely "as is".
  1177. X *
  1178. X * $Id: bump.c,v 4.0 91/07/17 14:41:39 kolb Exp Locker: kolb $
  1179. X *
  1180. X * $Log:    bump.c,v $
  1181. X * Revision 4.0  91/07/17  14:41:39  kolb
  1182. X * Initial version.
  1183. X * 
  1184. X */
  1185. X#include "texture.h"
  1186. X#include "bump.h"
  1187. X
  1188. X/*
  1189. X * Create and return a reference to a "bump" texture.
  1190. X */
  1191. XBump *
  1192. XBumpCreate(size)
  1193. XFloat size;
  1194. X{
  1195. X    Bump *bump;
  1196. X
  1197. X    bump = (Bump *)Malloc(sizeof(Bump));
  1198. X    bump->size = size;
  1199. X    return bump;
  1200. X}
  1201. X
  1202. X/*
  1203. X * Apply a "bump" texture.
  1204. X */
  1205. Xvoid
  1206. XBumpApply(bump, prim, ray, pos, norm, gnorm, surf)
  1207. XBump *bump;
  1208. XGeom *prim;
  1209. XRay *ray;
  1210. XVector *pos, *norm, *gnorm;
  1211. XSurface *surf;
  1212. X{
  1213. X    Vector disp;
  1214. X
  1215. X    DNoise3(pos, &disp);
  1216. X    norm->x += disp.x * bump->size;
  1217. X    norm->y += disp.y * bump->size;
  1218. X    norm->z += disp.z * bump->size;
  1219. X    (void)VecNormalize(norm);
  1220. X}
  1221. END_OF_FILE
  1222. if test 1213 -ne `wc -c <'libray/libtext/bump.c'`; then
  1223.     echo shar: \"'libray/libtext/bump.c'\" unpacked with wrong size!
  1224. fi
  1225. # end of 'libray/libtext/bump.c'
  1226. fi
  1227. if test -f 'libray/libtext/checker.c' -a "${1}" != "-c" ; then 
  1228.   echo shar: Will not clobber existing file \"'libray/libtext/checker.c'\"
  1229. else
  1230. echo shar: Extracting \"'libray/libtext/checker.c'\" \(1341 characters\)
  1231. sed "s/^X//" >'libray/libtext/checker.c' <<'END_OF_FILE'
  1232. X/*
  1233. X * checker.c
  1234. X *
  1235. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1236. X * All rights reserved.
  1237. X *
  1238. X * This software may be freely copied, modified, and redistributed
  1239. X * provided that this copyright notice is preserved on all copies.
  1240. X *
  1241. X * You may not distribute this software, in whole or in part, as part of
  1242. X * any commercial product without the express consent of the authors.
  1243. X *
  1244. X * There is no warranty or other guarantee of fitness of this software
  1245. X * for any purpose.  It is provided solely "as is".
  1246. X *
  1247. X * $Id: checker.c,v 4.0 91/07/17 14:41:48 kolb Exp Locker: kolb $
  1248. X *
  1249. X * $Log:    checker.c,v $
  1250. X * Revision 4.0  91/07/17  14:41:48  kolb
  1251. X * Initial version.
  1252. X * 
  1253. X */
  1254. X#include "texture.h"
  1255. X#include "checker.h"
  1256. X
  1257. X/*
  1258. X * Create and return a reference to a "checker" texture.
  1259. X */
  1260. XChecker *
  1261. XCheckerCreate(surf)
  1262. XSurface *surf;
  1263. X{
  1264. X    Checker *checker;
  1265. X    checker = (Checker *)Malloc(sizeof(checker));
  1266. X    checker->surf = surf;
  1267. X    return checker;
  1268. X}
  1269. X
  1270. X/*
  1271. X * Apply a "checker" texture.
  1272. X */
  1273. Xvoid
  1274. XCheckerApply(checker, prim, ray, pos, norm, gnorm, surf)
  1275. XChecker *checker;
  1276. XGeom *prim;
  1277. XRay *ray;
  1278. XVector *pos, *norm, *gnorm;
  1279. XSurface *surf;
  1280. X{
  1281. X    int xp, yp, zp;
  1282. X
  1283. X    xp = pos->x > 0. ? pos->x : 1. - pos->x;
  1284. X    yp = pos->y > 0. ? pos->y : 1. - pos->y;
  1285. X    zp = pos->z > 0. ? pos->z : 1. - pos->z;
  1286. X
  1287. X    if ((xp + yp + zp) % 2)
  1288. X        *surf = *checker->surf;
  1289. X    /* else surface stays the same. */
  1290. X}
  1291. END_OF_FILE
  1292. if test 1341 -ne `wc -c <'libray/libtext/checker.c'`; then
  1293.     echo shar: \"'libray/libtext/checker.c'\" unpacked with wrong size!
  1294. fi
  1295. # end of 'libray/libtext/checker.c'
  1296. fi
  1297. if test -f 'libray/libtext/fbmbump.c' -a "${1}" != "-c" ; then 
  1298.   echo shar: Will not clobber existing file \"'libray/libtext/fbmbump.c'\"
  1299. else
  1300. echo shar: Extracting \"'libray/libtext/fbmbump.c'\" \(1284 characters\)
  1301. sed "s/^X//" >'libray/libtext/fbmbump.c' <<'END_OF_FILE'
  1302. X/*
  1303. X * fbmbump.c
  1304. X *
  1305. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1306. X * All rights reserved.
  1307. X *
  1308. X * This software may be freely copied, modified, and redistributed
  1309. X * provided that this copyright notice is preserved on all copies.
  1310. X *
  1311. X * You may not distribute this software, in whole or in part, as part of
  1312. X * any commercial product without the express consent of the authors.
  1313. X *
  1314. X * There is no warranty or other guarantee of fitness of this software
  1315. X * for any purpose.  It is provided solely "as is".
  1316. X *
  1317. X * $Id: fbmbump.c,v 4.0 91/07/17 14:42:21 kolb Exp Locker: kolb $
  1318. X *
  1319. X * $Log:    fbmbump.c,v $
  1320. X * Revision 4.0  91/07/17  14:42:21  kolb
  1321. X * Initial version.
  1322. X * 
  1323. X */
  1324. X#include "texture.h"
  1325. X#include "fbm.h"
  1326. X#include "fbmbump.h"
  1327. X
  1328. XFBm *
  1329. XFBmBumpCreate(offset, scale, h, lambda, octaves)
  1330. XFloat offset, h, lambda, scale;
  1331. Xint octaves;
  1332. X{
  1333. X    FBm *fbm;
  1334. X    fbm = FBmCreate(offset, scale, h, lambda, octaves, 0., (char *)NULL);
  1335. X    return fbm;
  1336. X}
  1337. X
  1338. X/*ARGSUSED*/
  1339. Xvoid
  1340. XFBmBumpApply(fbm, prim, ray, pos, norm, gnorm, surf)
  1341. XFBm *fbm;
  1342. XGeom *prim;
  1343. XRay *ray;
  1344. XVector *pos, *norm, *gnorm;
  1345. XSurface *surf;
  1346. X{
  1347. X    Vector disp;
  1348. X
  1349. X    VfBm(pos, fbm->omega, fbm->lambda, fbm->octaves, &disp);
  1350. X    norm->x += fbm->offset + disp.x * fbm->scale;
  1351. X    norm->y += fbm->offset + disp.y * fbm->scale;
  1352. X    norm->z += fbm->offset + disp.z * fbm->scale;
  1353. X}
  1354. END_OF_FILE
  1355. if test 1284 -ne `wc -c <'libray/libtext/fbmbump.c'`; then
  1356.     echo shar: \"'libray/libtext/fbmbump.c'\" unpacked with wrong size!
  1357. fi
  1358. # end of 'libray/libtext/fbmbump.c'
  1359. fi
  1360. if test -f 'libray/libtext/gloss.c' -a "${1}" != "-c" ; then 
  1361.   echo shar: Will not clobber existing file \"'libray/libtext/gloss.c'\"
  1362. else
  1363. echo shar: Extracting \"'libray/libtext/gloss.c'\" \(1477 characters\)
  1364. sed "s/^X//" >'libray/libtext/gloss.c' <<'END_OF_FILE'
  1365. X/*
  1366. X * gloss.c
  1367. X *
  1368. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1369. X * All rights reserved.
  1370. X *
  1371. X * This software may be freely copied, modified, and redistributed
  1372. X * provided that this copyright notice is preserved on all copies.
  1373. X *
  1374. X * You may not distribute this software, in whole or in part, as part of
  1375. X * any commercial product without the express consent of the authors.
  1376. X *
  1377. X * There is no warranty or other guarantee of fitness of this software
  1378. X * for any purpose.  It is provided solely "as is".
  1379. X *
  1380. X * $Id: gloss.c,v 4.0 91/07/17 14:42:30 kolb Exp Locker: kolb $
  1381. X *
  1382. X * $Log:    gloss.c,v $
  1383. X * Revision 4.0  91/07/17  14:42:30  kolb
  1384. X * Initial version.
  1385. X * 
  1386. X */
  1387. X#include "texture.h"
  1388. X#include "gloss.h"
  1389. X
  1390. XGloss *
  1391. XGlossCreate(glossiness)
  1392. XFloat glossiness;
  1393. X{
  1394. X    Gloss *gloss;
  1395. X
  1396. X    gloss = (Gloss *)Malloc(sizeof(Gloss));
  1397. X    gloss->glossy = 1. - glossiness;
  1398. X    return gloss;
  1399. X}
  1400. X
  1401. Xvoid
  1402. XGlossApply(gloss, prim, ray, pos, norm, gnorm, surf)
  1403. XGloss *gloss;
  1404. XGeom *prim;
  1405. XRay *ray;
  1406. XVector *pos, *norm, *gnorm;
  1407. XSurface *surf;
  1408. X{
  1409. X    Vector uaxis, vaxis, point, norminc;
  1410. X    extern void UnitCirclePoint();
  1411. X
  1412. X    /*
  1413. X     * Find coordinate system with norm as the Z axis.
  1414. X     */
  1415. X    VecCoordSys(norm, &uaxis, &vaxis);
  1416. X    /*
  1417. X     * Find point on unit circle based on sample #.
  1418. X     */
  1419. X    UnitCirclePoint(&point, ray->sample);
  1420. X    /*
  1421. X     * Perturb normal appropriately.
  1422. X     */
  1423. X    VecComb(gloss->glossy * point.x, uaxis,
  1424. X        gloss->glossy * point.y, vaxis,
  1425. X        &norminc);
  1426. X    VecAdd(*norm, norminc, norm);
  1427. X    /*
  1428. X     * Renormalize.
  1429. X     */
  1430. X    (void)VecNormalize(norm);
  1431. X}
  1432. END_OF_FILE
  1433. if test 1477 -ne `wc -c <'libray/libtext/gloss.c'`; then
  1434.     echo shar: \"'libray/libtext/gloss.c'\" unpacked with wrong size!
  1435. fi
  1436. # end of 'libray/libtext/gloss.c'
  1437. fi
  1438. if test -f 'libray/libtext/imagetext.h' -a "${1}" != "-c" ; then 
  1439.   echo shar: Will not clobber existing file \"'libray/libtext/imagetext.h'\"
  1440. else
  1441. echo shar: Extracting \"'libray/libtext/imagetext.h'\" \(1222 characters\)
  1442. sed "s/^X//" >'libray/libtext/imagetext.h' <<'END_OF_FILE'
  1443. X/*
  1444. X * imagetext.h
  1445. X *
  1446. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1447. X * All rights reserved.
  1448. X *
  1449. X * This software may be freely copied, modified, and redistributed
  1450. X * provided that this copyright notice is preserved on all copies.
  1451. X *
  1452. X * You may not distribute this software, in whole or in part, as part of
  1453. X * any commercial product without the express consent of the authors.
  1454. X *
  1455. X * There is no warranty or other guarantee of fitness of this software
  1456. X * for any purpose.  It is provided solely "as is".
  1457. X *
  1458. X * $Id: imagetext.h,v 4.0 91/07/17 14:42:47 kolb Exp Locker: kolb $
  1459. X *
  1460. X * $Log:    imagetext.h,v $
  1461. X * Revision 4.0  91/07/17  14:42:47  kolb
  1462. X * Initial version.
  1463. X * 
  1464. X */
  1465. X#ifndef IMAGETEXT_H
  1466. X#define IMAGETEXT_H
  1467. X
  1468. X#define TextImageCreate(s) TextCreate((TextRef)ImageTextCreate(s), \
  1469. X                ImageTextApply)
  1470. X
  1471. Xtypedef struct {
  1472. X    Image    *image;        /* image to use */
  1473. X    Surface *surf;        /* Alternative surface */
  1474. X    int    component,    /* component to texture */
  1475. X        smooth;        /* interpolate pixel values? */
  1476. X    Float    lo, hi;        /* high and low values in image */
  1477. X    Float    tileu, tilev;    /* tiling control */
  1478. X    Mapping    *mapping;
  1479. X} ImageText;
  1480. X
  1481. Xextern ImageText *ImageTextCreate();
  1482. Xextern void ImageTextApply(), ImageTextSetComponent();
  1483. X
  1484. X#endif /* IMAGETEXT_H */
  1485. END_OF_FILE
  1486. if test 1222 -ne `wc -c <'libray/libtext/imagetext.h'`; then
  1487.     echo shar: \"'libray/libtext/imagetext.h'\" unpacked with wrong size!
  1488. fi
  1489. # end of 'libray/libtext/imagetext.h'
  1490. fi
  1491. if test -f 'libray/libtext/mount.c' -a "${1}" != "-c" ; then 
  1492.   echo shar: Will not clobber existing file \"'libray/libtext/mount.c'\"
  1493. else
  1494. echo shar: Extracting \"'libray/libtext/mount.c'\" \(1523 characters\)
  1495. sed "s/^X//" >'libray/libtext/mount.c' <<'END_OF_FILE'
  1496. X/*
  1497. X * mount.c
  1498. X *
  1499. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1500. X * All rights reserved.
  1501. X *
  1502. X * This software may be freely copied, modified, and redistributed
  1503. X * provided that this copyright notice is preserved on all copies.
  1504. X *
  1505. X * You may not distribute this software, in whole or in part, as part of
  1506. X * any commercial product without the express consent of the authors.
  1507. X *
  1508. X * There is no warranty or other guarantee of fitness of this software
  1509. X * for any purpose.  It is provided solely "as is".
  1510. X *
  1511. X * $Id: mount.c,v 4.0 91/07/17 14:43:17 kolb Exp Locker: kolb $
  1512. X *
  1513. X * $Log:    mount.c,v $
  1514. X * Revision 4.0  91/07/17  14:43:17  kolb
  1515. X * Initial version.
  1516. X * 
  1517. X */
  1518. X#include "texture.h"
  1519. X#include "mount.h"
  1520. X
  1521. X/*
  1522. X * Create and return a reference to a "mount" texture.
  1523. X */
  1524. XMount *
  1525. XMountCreate(cmap, turb, slope)
  1526. Xchar *cmap;
  1527. XFloat turb, slope;
  1528. X{
  1529. X    Mount *mount;
  1530. X
  1531. X    mount = (Mount *)Malloc(sizeof(Mount));
  1532. X    mount->turb = turb;
  1533. X    mount->slope = slope;
  1534. X    mount->cmap = ColormapRead(cmap);
  1535. X    return mount;
  1536. X}
  1537. X
  1538. X/*
  1539. X * Apply a "mount" texture.
  1540. X */
  1541. Xvoid
  1542. XMountApply(mount, prim, ray, pos, norm, gnorm, surf)
  1543. XMount *mount;
  1544. XGeom *prim;
  1545. XRay *ray;
  1546. XVector *pos, *norm, *gnorm;
  1547. XSurface *surf;
  1548. X{
  1549. X    int index;
  1550. X    Float t;
  1551. X    Color c;
  1552. X
  1553. X    t = Chaos(pos, 7);
  1554. X    index = (pos->z + mount->turb*t - mount->slope*(1.-norm->z))*256;
  1555. X    if (index < 0)
  1556. X        index = 0;
  1557. X    if (index > 255)
  1558. X        index = 255;
  1559. X
  1560. X    ColorMultiply(surf->amb, mount->cmap[index], &surf->amb);
  1561. X    ColorMultiply(surf->diff, mount->cmap[index], &surf->diff);
  1562. X    ColorMultiply(surf->spec, mount->cmap[index], &surf->spec);
  1563. X}
  1564. END_OF_FILE
  1565. if test 1523 -ne `wc -c <'libray/libtext/mount.c'`; then
  1566.     echo shar: \"'libray/libtext/mount.c'\" unpacked with wrong size!
  1567. fi
  1568. # end of 'libray/libtext/mount.c'
  1569. fi
  1570. if test -f 'libshade/builtin.c' -a "${1}" != "-c" ; then 
  1571.   echo shar: Will not clobber existing file \"'libshade/builtin.c'\"
  1572. else
  1573. echo shar: Extracting \"'libshade/builtin.c'\" \(1383 characters\)
  1574. sed "s/^X//" >'libshade/builtin.c' <<'END_OF_FILE'
  1575. X/*
  1576. X * builtin.c
  1577. X *
  1578. X * Copyright (C) 1989, 1991, Craig E. Kolb, Rod G. Bogart
  1579. X * All rights reserved.
  1580. X *
  1581. X * This software may be freely copied, modified, and redistributed
  1582. X * provided that this copyright notice is preserved on all copies.
  1583. X *
  1584. X * You may not distribute this software, in whole or in part, as part of
  1585. X * any commercial product without the express consent of the authors.
  1586. X * 
  1587. X * There is no warranty or other guarantee of fitness of this software
  1588. X * for any purpose.  It is provided solely "as is".
  1589. X *
  1590. X * $Id: builtin.c,v 4.0 91/07/17 14:45:00 kolb Exp Locker: kolb $
  1591. X *
  1592. X * $Log:    builtin.c,v $
  1593. X * Revision 4.0  91/07/17  14:45:00  kolb
  1594. X * Initial version.
  1595. X * 
  1596. X */
  1597. X
  1598. X#include "rayshade.h"
  1599. X
  1600. XFloat
  1601. XSumExpr(a, b)
  1602. XFloat a, b;
  1603. X{
  1604. X    return a + b;
  1605. X}
  1606. XFloat
  1607. XDiffExpr(a, b)
  1608. XFloat a, b;
  1609. X{
  1610. X    return a - b;
  1611. X}
  1612. X
  1613. XFloat
  1614. XMultExpr(a, b)
  1615. XFloat a, b;
  1616. X{
  1617. X    return a * b;
  1618. X}
  1619. XFloat
  1620. XDivideExpr(a, b)
  1621. XFloat a, b;
  1622. X{
  1623. X    return a / b;
  1624. X}
  1625. X
  1626. XFloat
  1627. XModExpr(a, b)
  1628. XFloat a, b;
  1629. X{
  1630. X    return (Float)((int)a % (int)b);
  1631. X}
  1632. X
  1633. XFloat
  1634. XNegateExpr(a)
  1635. XFloat a;
  1636. X{
  1637. X    return -a;
  1638. X}
  1639. X
  1640. XFloat
  1641. XLinearTime(starttime, startval, endtime, endval)
  1642. XFloat starttime, endtime, startval, endval;
  1643. X{
  1644. X    if (TimeExpr->value < starttime)
  1645. X        return startval;
  1646. X    if (TimeExpr->value > endtime)
  1647. X        return endval;
  1648. X    if (equal(endtime, starttime))
  1649. X        return startval;
  1650. X    return startval + (endval - startval) * 
  1651. X        (TimeExpr->value - starttime) / (endtime - starttime);
  1652. X}
  1653. END_OF_FILE
  1654. if test 1383 -ne `wc -c <'libshade/builtin.c'`; then
  1655.     echo shar: \"'libshade/builtin.c'\" unpacked with wrong size!
  1656. fi
  1657. # end of 'libshade/builtin.c'
  1658. fi
  1659. if test -f 'libshade/stats.h' -a "${1}" != "-c" ; then 
  1660.   echo shar: Will not clobber existing file \"'libshade/stats.h'\"
  1661. else
  1662. echo shar: Extracting \"'libshade/stats.h'\" \(1395 characters\)
  1663. sed "s/^X//" >'libshade/stats.h' <<'END_OF_FILE'
  1664. X/*
  1665. X * stats.h
  1666. X *
  1667. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1668. X * All rights reserved.
  1669. X *
  1670. X * This software may be freely copied, modified, and redistributed
  1671. X * provided that this copyright notice is preserved on all copies.
  1672. X *
  1673. X * You may not distribute this software, in whole or in part, as part of
  1674. X * any commercial product without the express consent of the authors.
  1675. X *
  1676. X * There is no warranty or other guarantee of fitness of this software
  1677. X * for any purpose.  It is provided solely "as is".
  1678. X *
  1679. X * $Id: stats.h,v 4.0 91/07/17 14:47:46 kolb Exp Locker: kolb $
  1680. X *
  1681. X * $Log:    stats.h,v $
  1682. X * Revision 4.0  91/07/17  14:47:46  kolb
  1683. X * Initial version.
  1684. X * 
  1685. X */
  1686. X#ifndef STATS_H
  1687. X#define STATS_H
  1688. X
  1689. X/*
  1690. X * Statistics
  1691. X */
  1692. Xtypedef struct RSStats {
  1693. X    unsigned long    EyeRays,    /* # of eye rays spawned */
  1694. X            ShadowRays,    /* # of shadow rays spawned */
  1695. X            ReflectRays,    /* # of reflected rays */
  1696. X            RefractRays,    /* # of refracted rays */
  1697. X            HitRays,    /* # of rays that hit something. */
  1698. X            BVTests,    /* # of bounding volume tests. */
  1699. X            SuperSampled,    /* # of supersampled pixels. */
  1700. X            ShadowHits,    /* # of shadow ray hits */
  1701. X            CacheHits,    /* # of shadow cache hits */
  1702. X            CacheMisses;    /* # of shadow cache misses */
  1703. X    Float        Utime,        /* User time */
  1704. X            Stime;        /* System time */
  1705. X    FILE        *fstats;    /* Stats/info file pointer. */
  1706. X} RSStats;
  1707. X
  1708. Xextern RSStats Stats;
  1709. Xextern void StatsPrint(), StatsAddRep();
  1710. X
  1711. X#endif /* STATS_H */
  1712. END_OF_FILE
  1713. if test 1395 -ne `wc -c <'libshade/stats.h'`; then
  1714.     echo shar: \"'libshade/stats.h'\" unpacked with wrong size!
  1715. fi
  1716. # end of 'libshade/stats.h'
  1717. fi
  1718. if test -f 'libshade/symtab.h' -a "${1}" != "-c" ; then 
  1719.   echo shar: Will not clobber existing file \"'libshade/symtab.h'\"
  1720. else
  1721. echo shar: Extracting \"'libshade/symtab.h'\" \(1180 characters\)
  1722. sed "s/^X//" >'libshade/symtab.h' <<'END_OF_FILE'
  1723. X/*
  1724. X * symtab.h
  1725. X *
  1726. X * Copyright (C) 1989, 1991, Craig E. Kolb, Rod G. Bogart
  1727. X * All rights reserved.
  1728. X *
  1729. X * This software may be freely copied, modified, and redistributed
  1730. X * provided that this copyright notice is preserved on all copies.
  1731. X *
  1732. X * You may not distribute this software, in whole or in part, as part of
  1733. X * any commercial product without the express consent of the authors.
  1734. X * 
  1735. X * There is no warranty or other guarantee of fitness of this software
  1736. X * for any purpose.  It is provided solely "as is".
  1737. X *
  1738. X * $Id: symtab.h,v 4.0 91/07/17 14:48:12 kolb Exp Locker: kolb $
  1739. X *
  1740. X * $Log:    symtab.h,v $
  1741. X * Revision 4.0  91/07/17  14:48:12  kolb
  1742. X * Initial version.
  1743. X * 
  1744. X */
  1745. X
  1746. X#ifndef SYMTAB_H
  1747. X#define SYMTAB_H
  1748. X
  1749. Xtypedef Float (*FloatFuncPtr)();
  1750. X
  1751. Xstruct SymtabPredefinedEntry {
  1752. X    char * name;
  1753. X    Float f;
  1754. X    FloatFuncPtr fp;
  1755. X    int type;
  1756. X    int timevary;
  1757. X    int params;
  1758. X};
  1759. X
  1760. Xtypedef    union {
  1761. X    Float (*fp)();
  1762. X    Expr *expr;
  1763. X} SymtabValue;
  1764. X
  1765. Xtypedef struct SymtabEntry {
  1766. X    char     *name;
  1767. X    SymtabValue value;
  1768. X    int type;
  1769. X    int timevary;
  1770. X    int params;
  1771. X    struct SymtabEntry *next;
  1772. X} SymtabEntry;
  1773. X
  1774. Xextern Expr *ExprFloatSymtabFind();
  1775. Xextern SymtabEntry *SymtabFind(), *SymtabBuiltinFind();
  1776. X
  1777. X#endif /* SYMTAB_H */
  1778. END_OF_FILE
  1779. if test 1180 -ne `wc -c <'libshade/symtab.h'`; then
  1780.     echo shar: \"'libshade/symtab.h'\" unpacked with wrong size!
  1781. fi
  1782. # end of 'libshade/symtab.h'
  1783. fi
  1784. if test -f 'libshade/viewing.h' -a "${1}" != "-c" ; then 
  1785.   echo shar: Will not clobber existing file \"'libshade/viewing.h'\"
  1786. else
  1787. echo shar: Extracting \"'libshade/viewing.h'\" \(1564 characters\)
  1788. sed "s/^X//" >'libshade/viewing.h' <<'END_OF_FILE'
  1789. X/*
  1790. X * viewing.h
  1791. X *
  1792. X * Copyright (C) 1989, 1991, Craig E. Kolb
  1793. X * All rights reserved.
  1794. X *
  1795. X * This software may be freely copied, modified, and redistributed
  1796. X * provided that this copyright notice is preserved on all copies.
  1797. X *
  1798. X * You may not distribute this software, in whole or in part, as part of
  1799. X * any commercial product without the express consent of the authors.
  1800. X *
  1801. X * There is no warranty or other guarantee of fitness of this software
  1802. X * for any purpose.  It is provided solely "as is".
  1803. X *
  1804. X * $Id: viewing.h,v 4.0 91/07/17 14:48:26 kolb Exp Locker: kolb $
  1805. X *
  1806. X * $Log:    viewing.h,v $
  1807. X * Revision 4.0  91/07/17  14:48:26  kolb
  1808. X * Initial version.
  1809. X * 
  1810. X */
  1811. X#ifndef VIEWING_H
  1812. X#define VIEWING_H
  1813. X
  1814. X/*
  1815. X * Screen
  1816. X */
  1817. Xtypedef struct RSScreen {
  1818. X    int    xres, yres,        /* Resolution of entire screen */
  1819. X        xsize, ysize,        /* Resolution of window */
  1820. X        minx, miny, maxx, maxy; /* Window to be rendered */
  1821. X    Vector    scrnx, scrny,        /* Horizontal & vertical screen axes */
  1822. X        scrni, scrnj,        /* Normalized versions of the above */
  1823. X        firstray;        /* Direction from eye to screen UL  */
  1824. X    Color    background;        /* Background color */
  1825. X} RSScreen;
  1826. X
  1827. X/*
  1828. X * Camera
  1829. X */
  1830. Xtypedef struct {
  1831. X    Vector    pos,            /* Eye position */
  1832. X        lookp,            /* Look position */
  1833. X        dir,            /* Look direction */
  1834. X        up;            /* 'Up' vector */
  1835. X    Float    hfov, vfov,        /* Horizontal/vertical field of view */
  1836. X        lookdist,        /* Eye pos/look pos distance */
  1837. X        aperture,        /* Aperture width (0 == pinhole) */
  1838. X        focaldist;        /* Distance from eye to focal plane */
  1839. X} RSCamera;
  1840. X
  1841. Xextern RSScreen Screen;
  1842. Xextern RSCamera Camera;
  1843. X
  1844. X#endif /* VIEWING_H */
  1845. END_OF_FILE
  1846. if test 1564 -ne `wc -c <'libshade/viewing.h'`; then
  1847.     echo shar: \"'libshade/viewing.h'\" unpacked with wrong size!
  1848. fi
  1849. # end of 'libshade/viewing.h'
  1850. fi
  1851. echo shar: End of archive 3 \(of 19\).
  1852. cp /dev/null ark3isdone
  1853. MISSING=""
  1854. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  1855.     if test ! -f ark${I}isdone ; then
  1856.     MISSING="${MISSING} ${I}"
  1857.     fi
  1858. done
  1859. if test "${MISSING}" = "" ; then
  1860.     echo You have unpacked all 19 archives.
  1861.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1862. else
  1863.     echo You still need to unpack the following archives:
  1864.     echo "        " ${MISSING}
  1865. fi
  1866. ##  End of shell archive.
  1867. exit 0
  1868.  
  1869. exit 0 # Just in case...
  1870.